home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / resocd / res_glob.bas < prev    next >
BASIC Source File  |  1995-05-09  |  3KB  |  89 lines

  1.  
  2. 'Resources Bar program, 12-6-92
  3.  
  4.  
  5. 'This allows me to pass around the parameters
  6. ' that I get out of the .ini file to correctly set
  7. ' up the sounds.
  8. Global TopOfHour As String
  9. Global BottOfHour As String
  10. Global NewTopOfHour As String
  11. Global NewBottOfHour As String
  12. Global NL As String  '= Chr$(13) + Chr$(10) carriage return for message boxes
  13.  
  14.  
  15. 'Now I Can write "true" and "false" instead of
  16. ' 0 and -1
  17. Global Const TRUE = -1
  18. Global Const FALSE = 0
  19.  
  20. 'Set up key recognition so I can use the
  21. ' name not the number
  22. Global Const Escape = &H1B
  23. Global Const KEY_F1 = &H70
  24. Global Const UpArrow = &H26
  25. Global Const DownArrow = &H28
  26. Global Const RightArrow = &H27
  27. Global Const LeftArrow = &H25
  28.  
  29.  
  30. 'Stay on Top
  31. Declare Function SetWindowPos Lib "user" (ByVal h%, ByVal hb%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal f%) As Integer
  32. Global Const SWP_NOMOVE = 2
  33. Global Const tSWP_NOSIZE = 1 'I added the "t" to elim. error mess because the move with mouse uses same name but diff. value ??? but this one dowen'seem to be used anywhere... but it works
  34. Global Const FLAGS = SWP_NOMOVE Or tSWP_NOSIZE
  35. Global Const HWND_TOPMOST = -1
  36. Global Const HWND_NOTOPMOST = -2
  37.  
  38.   'Check when form loses focus
  39.   Global Focus  As Integer
  40.   Declare Function GetActiveWindow Lib "User" () As Integer
  41.  
  42.   'Used to set/reset form when got/lost focus (now I can
  43.   ' just type the color names).
  44.   Global Const Black = &H0&
  45.   Global Const Red = &HFF&
  46.   Global Const Blue = &HFF0000
  47.   Global Const White = &HFFFFFF
  48.   Global Const Grey = &HC0C0C0
  49.  
  50. 'Free Memory
  51. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags As Integer) As Long
  52.  
  53. 'Free Resources
  54. Declare Function GetFreeSystemResources Lib "User" (ByVal fuSysResource As Integer) As Integer
  55. Global Const GFSR_SYSTEMRESOURCES = 0
  56.  
  57. 'This is for Windows version verification
  58. Declare Function GetVersion Lib "Kernel" () As Integer
  59.  
  60. 'For DING on the hour and 1/2 hour
  61. Declare Function SndPlaySound Lib "mmsystem" (ByVal FileName$, ByVal snd_async%) As Integer
  62.  
  63. 'To handle .ini file operations
  64. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  65. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  66. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String) As Integer
  67.  
  68. 'Move window with the mouse
  69.  
  70. Type POINTAPI
  71.    X As Integer
  72.    Y As Integer
  73. End Type
  74.  
  75. Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)
  76. Declare Sub ScreenToClient Lib "User" (ByVal hWnd As Integer, lpPoint As POINTAPI)
  77. ' I remed this out and used the function declar. in the stay on top area
  78. 'Declare Sub SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer)
  79.  
  80. Global Const SWP_NOSIZE = &H1
  81. Global Const Left_Button = 1
  82. Global CurPos As POINTAPI
  83. Global MyPosX As Integer
  84. Global MyPosY As Integer
  85.  
  86.  
  87.  
  88.  
  89.